class MyPlugin:
    def __init__(self, app=None):
        self.app = app
        if app is not None:
            self.init_app(app)

    def init_app(self, app):
        # 在这里初始化您的插件，例如注册蓝图、添加命令行接口等
        app.config['MY_PLUGIN_SETTING'] = 'some_value'
        app.extensions['my_plugin'] = self

    def do_something(self):
        # 在这里添加您的插件功能
        return "MyPlugin did something"